#ifndef SOKO_RETAINABLE_OBJECT_H
#define SOKO_RETAINABLE_OBJECT_H

namespace soko {


	template <class T>
	class RetainableObject {

		int _retainCount;

	public:

		RetainableObject() : _retainCount(1) {
		}
		
		T * retain() {
			return static_cast<T*>(this);
		}

		void release() {
			if (--_retainCount == 0);
		}

	};

}

using soko::RetainableObject;

#endif // SOKO_RETAINABLE_OBJECT_H
